package io.github.shenbinglife.springboot2.layui.common.model;

import java.util.List;
import java.util.function.Consumer;

public interface Tree {

    List<? extends Tree> getChildren();

    default void resolveDown(Consumer<? super Tree> consumer) {
        consumer.accept(this);
        if (getChildren() != null) {
            for (Tree child : getChildren()) {
                child.resolveDown(consumer);
            }
        }
    }
}
